<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Xgo_account_service{	
	var $wsUserName = '';
	var $wsPassword = '';
	var $wsdl = "http://ws.xgo6.net/WsXgo6.asmx?wsdl";
	var $client = NULL;
	
	function __construct(){
		$this->client = new SoapClient($this->wsdl);	
	}
	
    function init($para = array()){
		if(!empty($para)){
			foreach($para as $key => $value){
				$this->{$key} = $value;
			}
		}
		$this->client = new SoapClient($this->wsdl);
    }

    function CheckLogin($username, $password){
		$result = $this->client->CheckLogin(array(
			'wsUserName' => $this->wsUserName,
			'wsPassword' => $this->wsPassword,
			'UserName' => $username,
			'Password' => $password
		));
		
		return json_decode($result->CheckLoginResult);
	}
}
?>